import org.junit.Test;

import java.util.Arrays;

import static org.junit.Assert.*;

/**

 * Created by Administrator on 2017/5/10 0010.

 */
public class StringArrayDemoTest1 {
    String s1 = "abcde";
    String s2 = "aaa:bbb:ccc";
    String[] a1 = {"aaa","bbb","ccc"};
    int [] c1 = {2,5,3,4};
    char [] c2 = {'a','b','c','d'};
    @Test
    public void sort() throws Exception{
        Arrays.sort(c1);
        assertEquals(5,c1[3]);
    }

    @Test
    public void binarySearch() throws Exception{
        int c;
        c = Arrays.binarySearch(c2,'c');
        assertEquals(2,c);
    }
}